<%-- 
    Document   : account
    Created on : 19.07.2009, 00:15:36
    Author     : Mario
--%>

<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">

<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <link rel="stylesheet" type="text/css" href="serverStyles.css" />
        <title>JSP Page</title>
    </head>
    <body>
        <jsp:useBean id="prices" scope="session" class="de.stalinski.accounting.PricesTableConnector" />
        <jsp:useBean id="consumers" scope="session" class="de.stalinski.accounting.ConsumersConnector" />

        <jsp:useBean id="beep" scope="session" class="de.stalinski.util.Beep" />
        <%
        beep.beep();
        String fn = request.getParameter("fn");
        String sn = request.getParameter("sn");
        String sort = request.getParameter("sort");
        String amount = request.getParameter("amount");
        String un = request.getParameter("un");
        String id = request.getParameter("id");

        Double cost = Math.round((prices.getPriceFor(sort) * Integer.parseInt(amount)) * 100.) / 100.;

        %>
        <table class="accounting"><tbody>
                <tr>
                    <td>Buchung von: </td>
                    <td><%= fn + " " + sn%></td>
                </tr>
                <tr>
                    <td>Sorte: </td>
                    <td><%= sort%></td>
                </tr>
                <tr>
                    <td>Anzahl: </td>
                    <td><%= amount%></td>
                </tr>
                <tr>
                    <td>Kosten: </td>
                    <td><%= cost%>&nbsp;&euro;</td>
                </tr>



            </tbody>
        </table>
        <div class="account"><a href="index.jsp">Abbrechen</a>
            <a href="book.jsp?fn=<%= fn%>&sn=<%= sn%>&un=<%=un%>&id=<%=id%>&sort=<%= sort%>&amount=<%= amount%>">Buchen</a>
        </div>
    </body>
</html>
